<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="service.Model" %>
<%@ page import="po.User" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: xiaoli
  Date: 2024/3/14
  Time: 8:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>

  <FORM>
    <table align="center" border="1">
      <tr>
        <td>
          userId
        </td>
        <td>
          loginName
        </td>
        <td>
          loginPwd
        </td>
      </tr><%
      Model model=new Model();
      List<User> users = model.userSelect();
      for(int i=0;i<users.size();i++){
    %>
      <tr>
        <td><%out.print(users.get(i).getUserId());%></td>
        <td><%out.println(users.get(i).getLoginName());%></td>
        <td><%out.print(users.get(i).getLoginPwd());%></td>
        <td><a href="${pageContext.request.contextPath}/delete.jsp?id=<%=users.get(i).getUserId()%>">删除</a></td>
      </tr><%};%>
    </table>
  </FORM>
  <FORM ACTION="delete.jsp">
  <input  type="text" name="UserId">
  <button type="submit">提交</button>
  </FORM>
  </body>
</html>
